<template>
  <j-select-biz-component @handleCancel="noticeClose" @saveKaratAndCount="noticeSave" :width="1600" v-bind="configs" v-on="$listeners"/>
</template>

<script>
  import JSelectBizComponent from './JSelectBizComponent'

  export default {
    name: 'JSelectCustomerStyle',
    components: { JSelectBizComponent },
    props: ['value'],
    data() {
      return {
        settings: {
          name: '款式',
          displayKey: 'name',
          selectButtonText: '一键选款',
          returnKeys: ['codeNum','id' ],
          listUrl: '/styleInfo/styleInfo/list',
          queryParamCode: 'codeNum',
          queryParamText: '款号',
          // 多条件查询配置
          queryConfig: [
            {
              key: 'name',
              label: '款式名称'
            },{
              key: 'styleCate',
              label: '款类',
              dictCode: 'style_type'
            }
          ],
          columns: [
            { title: '款号', dataIndex: 'codeNum', align: 'center', width: '14%'},
            { title: '款式名称', dataIndex: 'name', align: 'center', width: '14%'},
            { title: '款类', dataIndex: 'styleCate_dictText', align: 'center', width: '12%'},
            { title: '图片', dataIndex: 'styleImageString', align: 'center', width: '16%' ,scopedSlots: { customRender: 'picSloto' }},
            { title: '连石重', dataIndex: 'withStoneWeight', align: 'center', width: '10%' },
            { title: '净金重', dataIndex: 'goldWeight', align: 'center', width: '10%' },
            { title: '净银重', dataIndex: 'silverModelWeight', align: 'center', width: '10%' },
            { title: '蜡重', dataIndex: 'waxModeWeight', align: 'center', width: '10%' }
          ]
        }
      }
    },
    computed: {
      configs() {
        return Object.assign({ value: this.value }, this.settings, this.$attrs)
      }
    },
    methods: {
      noticeClose(){
        this.$emit('handleCancel')
      },
      noticeSave(goldKaratArr,goldCountArr){
        this.$emit('saveKaratAndCount',goldKaratArr,goldCountArr)
      },
    }
  }
</script>

<style lang="less" scoped></style>